package cn.acac.yygh.enums;

/**
 * 用户状态的枚举
 */
public enum StatusEnum {
    LOCK(0,"锁定"),
    NORMAL(1,"正常");
    private Integer status;
    private String value;

    StatusEnum(Integer status, String value) {
        this.status = status;
        this.value = value;
    }

    /**
     * 根据状态获取相应的文字
     * @param status
     * @return
     */
   public static String findStatusStringByStatus(Integer status){
       StatusEnum[] values = StatusEnum.values();
       for (StatusEnum value : values) {
           if(value.status.intValue() == status.intValue()){
               return value.value;
           }
       }
       return "";
   }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return "StatusEnum{" +
                "status=" + status +
                ", value='" + value + '\'' +
                '}';
    }
}
